import React, { Component } from "react"
import { Route, Switch, Redirect } from "react-router-dom"
import Home from "./components/Home"
import About from "./components/About"
import MyNavLink from "./components/MyNavLink"
// import axios from 'axios'
export default class App extends Component {
  // axios.get().then().err()


  render() {
    return (
      <div>
        <MyNavLink to="/home">home</MyNavLink>
        <br />
        <MyNavLink to="/about">about</MyNavLink>
        <br />
        <br />
        <br />
        <br />
        <Switch>
          <Route path="/about" component={About}></Route>
          <Route path="/home" component={Home}></Route>
          <Redirect to="/about"></Redirect>
          {/* Redirect重定向 */}
          {/* <Route exact path="/home" component={Home}></Route> */}
          {/* exact 精准匹配 */}
        </Switch>
      </div>
    )
  }
}

